<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table class="form" id="form">
    <tr>
        <td class="formTitle">内容分类<font face="宋体">*</font></td>
        <td class="formValue">
            <select style="width: 150px" class="form-control"
                    isvalid="yes" id="type" disabled>
                <option value="0" disabled selected>请选择</option>
                <option value="1">业务介绍</option>
                <option value="2">时限查询</option>
                <option value="3">违禁品查询</option>
                <option value="4">海关政策</option>
                <option value="5">常见问题</option>
            </select>
        </td>
    </tr>
    <tr>
        <td class="formTitle">业务标题名称<font face="宋体">*</font></td>
        <td class="formValue">
            <input type="text" id="title" class="form-control" placeholder="业务标题名称" isvalid="yes"
                   checkexpession="NotNull" disabled>
        </td>
    </tr>
    <tr>
        <td class="formTitle">消息标题<font face="宋体">*</font></td>
        <td class="formValue">
            <input type="text" id="messageTitle" class="form-control" placeholder="消息标题" isvalid="yes"
                   checkexpession="NotNull" disabled>
        </td>
    </tr>
</table>
<script type="text/javascript" charset="utf-8" src="${ctxPath}/static/js/base/message/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctxPath}/static/js/base/message/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctxPath}/static/js/base/message/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="${ctxPath}/static/libs/jquery.min.js"></script>
<script type="text/javascript" src="${ctxPath}/static/libs/bootstrap.min.js"></script>
<link href="${ctxPath}/static/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<script id="editor" type="text/plain" name="gdesc" style="width:100%;height:350px;" ></script>

<input type="button" id="doSubmit" value="返回">

<script type="text/javascript">
    $(document).ready()
    {
        var ue = UE.getEditor('editor', {});
        var url = location.search;
        var messageId = url.split("=")[1];

        ue.addListener("ready", function () {
            $.ajax({
                url: '../../rest/message/info?id=' + messageId,
                type: 'get',
                success: function (data) {
                    if (data.code === 0) {
                        $("#type").val(data.rows.contentId);
                        $("#title").val(data.rows.businessName);
                        $("#messageTitle").val(data.rows.messageTitle)
                        ue.setContent(data.rows.messageData)
                        ue.setDisabled();
                    } else {
                        alert(data.msg)
                    }
                },
            })
        })
        $("#doSubmit").click(function () {
            window.location.href = "/base/message/list.html";
        })
    }
</script>
</body>
</html>